<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>
<body>
  <div id="app">
    <input type="text" v-model="msg">
      {{ msg.split('').reverse().join('') }}
      <hr>
      {{ reverseMsg() }}
      {{ reverseMsg() }}
      {{ reverseMsg() }}
      <hr>
      {{ msg2 }}
      {{ msg2 }}
      {{ msg2 }}
      {{ msg2 }}
      {{ msg2 }}
      {{ msg2 }}
      {{ msg2 }}{{ msg2 }}
      {{ msg2 }}
  </div>
  <script>
    let vm = new Vue({
      el:"#app",
      data:{
        msg:'hello world'
      },
      methods:{
        reverseMsg(){
          console.log("method调用了")
          return this.msg.split('').reverse().join('')
        }
      },
      computed:{
        msg2(){
          console.log("计算属性调用了")
          return this.msg.split('').reverse().join('')
        }
      }
    })
    console.log(vm)
  </script>
</body>
</html>